home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Python 1.1 / Demo / turing / dec.tm < prev    next >
Encoding:
Text File  |  1994-04-28  |  318 b   |  13 lines  |  [TEXT/R*ch]

  1. ;
  2. ; Decrement a number.  This is easy.
  3. ; The tape head points to the output.
  4. ;
  5.  
  6. <1, 'a'> --> <2, ' '>    ; decrement a sequence of a's
  7. <1, ' '> --> <0, L>    ; decrement zero
  8.  
  9. <1, 'S'> --> <2, ' '>    ; decrement SSSS....SSSS0
  10. <1, '0'> --> <0, L>    ; decrement zero
  11.  
  12. <2, ' '> --> <0, R>    ; move tape head right one before halting
  13.